//
//  fuzhi-extension.swift
//  WeiBo
//
//  Created by 涂永江 on 2017/6/4.
//  Copyright © 2017年 涂永江. All rights reserved.
//

import UIKit

  extension UIView{

    //设置x
    var x: CGFloat{
    
        get{
        
            return frame.origin.x
        }set{
        
            frame.origin.x = newValue
        }
    
    }
    //设置y

    var y: CGFloat{
        
        get{
            
            return frame.origin.y
        }set{
            
            frame.origin.y = newValue
        }
        
    }
    //设置宽度
    
    var width : CGFloat{
    
        get{
        
            return frame.size.width
        }set{
        
        frame.size.width = newValue
        }
    
    }
    //设置高度
    var height : CGFloat{
        
        get{
            
            return frame.size.height
        }set{
            
            frame.size.height = newValue
        }
        
    }
    
    //设置center
    
    var centerX : CGFloat
    {
    
        get{
        
            return center.x
        }set{
        
            center.x = newValue
        
        }
    }
    
    var centerY : CGFloat
    {
        
        get{
            
            return center.y
        }set{
            
            center.y = newValue
            
        }
    }
}
